package com.derbysoft.lowcostadapter.commons.redis.utils;

public class RedisValueBuilder {

    public static final int CAPACITY = 100;
    private StringBuilder stringBuilder = new StringBuilder(CAPACITY);

    private boolean isFirst = true;

    public void append(Object value) {
        if (!isFirst) {
            stringBuilder.append(KeyValueHelper.SEPARATOR);
        }
        stringBuilder.append(value == null ? KeyValueHelper.NULL : value);
        isFirst = false;
    }

    @Override
    public String toString() {
        return stringBuilder.toString();
    }
}
